/*
 * @Author: wangjq4214
 * @Date: 2022-05-03 15:36:47
 * @LastEditTime: 2022-05-03 22:40:58
 * @LastEditors: wangjq4214
 */
import { RouteObject } from 'react-router-dom';
import PageLayout from '@/layout';
import Login from '@/views/login';
import NotFound from '@/views/notFound';
import appRoutes from './modules';
import Auth from './Auth';

export const routers: RouteObject[] = [
  {
    path: '/login',
    element: <Login />,
    meta: {
      key: 'login',
    },
  },
  {
    path: '/',
    element: <Navigate to={'/dashboard'} />,
    meta: {
      key: 'index',
    },
  },
  {
    path: '/',
    element: (
      <Auth>
        <PageLayout />
      </Auth>
    ),
    children: appRoutes,
    meta: {
      key: 'root',
    },
  },
  {
    path: '*',
    element: <NotFound />,
    meta: {
      key: 'not-found',
    },
  },
];
